<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 数据表格</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <link href="css/account.css" rel="stylesheet">
    <script src="js/vue.sort.js"></script>
    <script src="/js/vue.min.js"></script>

    <style>

        #batch-add-name{width: 344px;text-align: center;}
        #batch-passwword{width: 344px;  text-align: center;    margin-left: 17px;  margin-top: 15px;}
        #batch-add-num{width: 344px;  text-align: center;  margin-top: 15px;}
        #connect{width: 344px;  text-align: center;  margin-top: 15px;}
        /*#batch-add-name{width: 290px;    margin-top: 15px;}*/
        #batch-add-date{margin-left: 17px;margin-top: 15px; width: 200px; text-align: center;}


        .ibox-content table th {
            line-height: 83px;
        }

        th
        {
            border: solid 1px #666;
            text-align: center;
            cursor: pointer; /*光标呈现为指示链接的指针（一只手）*/
        }

        .m-b{
            width: 160px;
        }

    </style>





    <style>
        .page-bar{
            margin:40px;
            margin-top: 20px;
            margin-left: -1px;
        }
        ul,li{
            margin: 0px;
            padding: 0px;
        }
        li{
            list-style: none
        }
        .page-bar li:first-child>a {
            margin-left: 0px
        }
        .page-bar a{
            border: 1px solid #ddd;
            text-decoration: none;
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #337ab7;
            cursor: pointer
        }
        .page-bar a:hover{
            background-color: #eee;
        }
        .page-bar a.banclick{
            cursor:not-allowed;
        }
        .page-bar .active a{
            color: #fff;
            cursor: default;
            background-color: #337ab7;
            border-color: #337ab7;
        }
        .page-bar i{
            font-style:normal;
            color: #d44950;
            margin: 0px 4px;
            font-size: 12px;
        }


        .sort-up{
            height: 10px;
            text-align: center;
            float: right;
            position: relative;
            top: -1px;
            left: 4px;
            width: 20px;
            /* margin-right: 3px; */
            /*border: 1px solid red;*/
        }


        .sort-desc{
            height: 10px;
            text-align: center;
            float: right;
            position: relative;
            left: 24px;
            top: 11px;
            width:20px;
            /*border:1px solid red;*/

        }


        .fa-sort-desc{
            position: relative;
            left: 0px;
            top: -8px;
        }

        .fa-sort-up{
            position: relative;
            left: 0px;
            top: -2px;
        }


        .contact-box{
            left: 0px;
            top: 2px;
            position: absolute;
            width: 300px;
            height: 260px;
        }

    </style>


    <script>
        var level = {{ Session::get('MEMBER_INFO')['level'] }};
        var primary_day = {{$discount['primary-day']}};
        var primary_week = {{$discount['primary-week']}};
        var primary_month = {{$discount['primary-month']}};
        var middle_day = {{$discount['middle-day']}};
        var middle_week = {{$discount['middle-week']}};
        var middle_month = {{$discount['middle-month']}};
        var height_day = {{$discount['height-day']}};
        var height_week = {{$discount['height-week']}};
        var height_month = {{$discount['height-month']}};
    </script>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins ">
                <div  id="app">
                <div class="ibox-title">
                    <button type="button" id="addaccount" class="btn btn-primary" data-toggle="modal" data-target="#myModal5">
                        添加账号
                    </button>
                    {{--<button type="button" id="batch-renew-account"  class="btn btn-primary" data-toggle="modal" data-target="#batch-renew-account-show">续费</button>--}}
                    <button type="button" id="batch-account-add"  class="btn btn-primary" data-toggle="modal" data-target="#batch-add-account">批量添加用户</button>
                    <button type="button" id="batch-account-delete"  class="btn btn-primary" data-toggle="modal" data-target="">批量删除用户</button>

                    <div  role="form" >
                        <div class="form-group" id="layer-date" >
                            <div class="col-sm-5" style="width: 220px;">
                                <input class="form-control layer-date" id="start_date"  name="start_date" value="{{ old('start_date') }}" placeholder="请选择开始时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </div>
                            <div class="col-sm-5" style="width: 220px;">
                                <input class="form-control layer-date" id="end_date"  name="end_date" value="{{ old('end_date') }}" placeholder="请选择结束时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </div>

                            <div class="col-sm-5" style="width: 220px;">
                                <input class="form-control " name="username" id="username"  value="{{ old('username') }}" placeholder="请选择用户名" >
                            </div>
                            <div v-show ='level == 2' class="col-sm-3" style="width: 110px;">
                                <select class="form-control m-b" id="manage_name" name="manage_name">
                                    <option value="">全部</option>
                                    @if(!empty($list))
                                        @foreach( $list as $value)
                                            <option value="{{$value['username']}}">{{ $value['username'] }}</option>
                                        @endforeach
                                    @endif
                                </select>
                            </div>

                            <div class="col-sm-5" id="filtrate" style="width: 220px;    margin-left: 60px;">
                                <input class="form-control" readonly  placeholder="筛选" value="" >

                                <div class="col-sm-4" id="filtrate-show"  style="display:none;">
                                    <div class="contact-box">
                                            <div>
                                                <label class="">账户类型：
                                                    <form action="">
                                                        <div class="radio">
                                                            <label>
                                                                <input type="radio" value="付费"  name="account-type">付费
                                                            </label>
                                                            <label style="margin-left: 55px;">
                                                                <input type="radio"   value="测试"  name="account-type">测试
                                                            </label>
                                                            <label style="margin-left: 40px;"  >
                                                                <input type="radio"  name="account-cancel">取消
                                                            </label>
                                                        </div>
                                                    </form>
                                                </label>
                                            </div>
                                            <div>
                                                <form action="">
                                                    <label class="">账号过期时间：
                                                        <div class="radio">
                                                            <label>
                                                                <input type="radio"  value="已到期"  name="expired_at">已到期
                                                            </label>
                                                            <label style="margin-left: 25px;">
                                                                <input type="radio"   value="未到期"  name="expired_at">未到期
                                                            </label>
                                                            <label style="margin-left: 20px;">
                                                                <input type="radio"   value="近三天到期"  name="expired_at">近三天到期
                                                            </label>
                                                            <label class="shaixuan">
                                                                <input type="radio"   value="近七天到期"  name="expired_at">近七天到期
                                                            </label>
                                                            <label style="margin-left: 107px;">
                                                                <input type="radio"    name="expired_cancel">取消
                                                            </label>
                                                        </div>
                                                    </label>
                                                </form>
                                            </div>

                                            <div>
                                                <form action="">
                                                    <label class="">套餐类型：
                                                        <div class="radio">
                                                            <label>
                                                                <input type="radio"  value="1"  name="set_meal_type">基础套餐
                                                            </label>
                                                            <label style="margin-left: 15px;">
                                                                <input type="radio"   value="2"  name="set_meal_type">中级套餐
                                                            </label>
                                                            <label style="margin-left: 15px;">
                                                                <input type="radio"   value="3"  name="set_meal_type">高级套餐
                                                            </label>
                                                            <label style="margin-left: 197px;">
                                                                <input type="radio"    name="set_meal_cancel">取消
                                                            </label>
                                                        </div>
                                                    </label>
                                                </form>
                                            </div>

                                    </div>
                                </div>
                            </div>
                            {{--<div id="filtrate-show" class="dropdown-menus">--}}
                                {{--<a href="">111</a>--}}
                            {{--</div>--}}


                            <button v-on:click="fromClick()"  class="btn btn-primary" style="margin-left: 15px; margin-top: 1px;" type="">查询</button>

                        </div>
                    </div>
                </div>

                <div class="ibox-content">

                        <table  class="table table-striped table-bordered table-hover  ">
                            <thead>
                            <tr >
                                <th style="display:none;">KEY</th>
                                <th style="display:none;">ID</th>
                                <th style="width:10px;"><input type="checkbox" onclick="selectAll()"></th>

                                <th v-show ='level == 2' type="string">代理商</th>

                                <th>账号</th>
                                <th>密码</th>
                                <th>连接数
                                    <button  data-type="order"  data-name="con_max" data-value="asc" class="sort-up"><i  class="fa fa-sort-up"></i></button>
                                    <button  data-type="order"  data-name="con_max" data-value="desc" class="sort-desc"><i class="fa fa-sort-desc"></i></button>
                                </th>
                                <th>账户类型</th>
                                <th>创建时间
                                    <button data-type="order"  data-name="created_at" data-value="asc"  class="sort-up"><i  class="fa fa-sort-up"></i></button>
                                    <button data-type="order"  data-name="created_at" data-value="desc"  class="sort-desc"><i class="fa fa-sort-desc"></i></button>
                                </th>
                                <th>到期时间
                                    <button data-type="order"  data-name="expired_at" data-value="asc"  class="sort-up"><i  class="fa fa-sort-up"></i></button>
                                    <button data-type="order"  data-name="expired_at" data-value="desc" class="sort-desc"><i class="fa fa-sort-desc"></i></button>
                                </th>
                                <th>到期</th>
                                <th>备注</th>
                                <th>套餐类型
                                </th>
                                <th v-show ='level == 2'>速度
                                </th>
                                <th style="width:230px;">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <div>
                                <tr v-for="(todo,index) in account">
                                    <td style="display:none;"></td>
                                    <td style="display:none;">@{{ index.id }}</td>
                                    <td><input name="check-box" type="checkbox"></td>
                                    <td v-show ='level == 2' v-text="index.manage_name"></td>


                                    <td v-text="index.username"></td>
                                    <td v-text="index.password"></td>
                                    <td v-text="index.connect_num"></td>
                                    <td v-text="index.account_type"></td>
                                    <td v-text="index.created_at"></td>
                                    <td v-text="index.expired_at"></td>
                                    <td style="color:red;font-size: 12px;margin-bottom: -16px;" v-text="index.time"></td>

                                    <td v-text="index.remark"></td>
                                    <td v-text="index.set_meal"></td>
                                    <td v-show='level == 2' v-text="index.value"></td>
                                    <td style="width: 80.545px;">
                                        <button v-show ='index.expired != 2 ' class="btn btn-info"  v-on:click="accountUpdate($event,index.id,index.value,index.password,index.username)" data-toggle="modal"   data-target="#updateAccount" type="button">编辑</button>
                                        <a v-show ='index.expired != 2' class="btn btn-success " href="/getaccountonlieInfo?account_id=@{{ index.id }}}"  type="button">详情</a>
                                        <button v-on:click="accountDelete($event,index.id)" data-id="@{{ index.id }}" class="btn btn-danger" type="button"><span class="bold">删除</span></button>
                                        <button v-on:click="renewClick($event,index.id,index.connect_num,index.username,index.password,index.set_meal_type)"  class="btn btn-info renew"
                                                 data-toggle="modal" data-target="#myModal4" type="button">
                                            <span class="bold">续费</span>
                                        </button>
                                    </td>
                                </tr>
                            </div>
                            </tbody>
                        </table>

                        <div v-show = 'all > 1' class="page-bar">
                            <ul>
                                <li v-if="cur>1"><a v-on:click="cur--,pageClick()">上一页</a></li>
                                <li v-if="cur==1"><a class="banclick">上一页</a></li>
                                <li v-for="index in indexs"  v-bind:class="{ 'active': cur == index}">
                                    <a v-on:click="btnClick(index)">@{{index}}</a>
                                </li>
                                <li v-if="cur!=all"><a v-on:click="cur++,pageClick()">下一页</a></li>
                                <li v-if="cur == all"><a class="banclick">下一页</a></li>
                                <li><a>共<i>@{{all}}</i>页</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            </div>
        </div>
    </div>
</div>


{{--添加账号--}}
<div  class="modal inmodal fade"  id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">添加账号</h4>
            </div>
            <div class="modal-body">

                <form class="form-horizontal" method="post" autocomplete="on"  action="/addAccount">
                    addAccount
                    <div class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">用户名：</label>

                        <div class="col-sm-8">
                            <input type="text" id="name" name="username" value="" autocomplete="new-password" placeholder="用户名 -- (英文字母加数字)"  class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">密码：</label>
                        <div class="col-sm-8">
                            <input type="password" id="password" name="password" value="" autocomplete="new-password"  placeholder="密码" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">连接数：</label>
                        <div class="col-sm-8">
                            <input type="text" name="concent_num" style="text-align: center;"   id="num" value="1" placeholder="请输入连接数" >
                        </div>
                    </div>
                    {!! csrf_field() !!}
                    <div class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">套餐类型：</label>
                        <div class="col-sm-8">
                            <input type="radio" name="set-meal-type" value="1" id="set-meal-primary">初级套餐&nbsp;&nbsp;
                            <input type="radio" name="set-meal-type" checked value="2" value="option2" id="set-meal-middle">中级套餐  &nbsp;  &nbsp;
                            <input type="radio" name="set-meal-type" value="3" value="option2" id="set-meal-height">高级套餐  &nbsp;  &nbsp;

                        </div>
                    </div>

                    <div class="form-group" >
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">账户类型：</label>
                        <div class="col-sm-8">
                            <input type="radio" checked  name="account_type" value="付费"  id="accountType1">付费  &nbsp;  &nbsp;
                            <input type="radio" name="account_type" value="测试" id="accountType2">测试&nbsp;&nbsp;

                        </div>
                    </div>
                    <input type="hidden" id="date_type" name="date_type" value="">
                    <div class="form-group" id="account-date">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label" style="margin-top: 14px;">时间：</label>
                        <div class="col-sm-8  form-inline">
                            <input type="text" name="date" style="text-align: center;" id="date" value="1" placeholder="请输入天数" >
                            <select style="margin-top: 13px" class="form-control m-b" id="discount" name="account">
                                <option id="day" selected  value="{{$discount['middle-day']}}">日</option >
                                <option id="week" value="{{$discount['middle-week']}}">周</option>
                                <option id="month" value="{{$discount['middle-month']}}">月</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">备注：</label>
                        <div class="col-sm-8">
                            <textarea name="remark" id="remark" cols="54" rows="3"></textarea>
                            <h5>说点什么吧，你可以输入<span style="color:red;">140</span>个字，现在剩余<span id="word" style="color:red;">140</span>个</h5>
                        </div>
                    </div>

                    <div id="total-money" class="form-group">
                        <label style="margin-left: 40px;" class="col-sm-3 control-label">金额：</label>
                        <span style="font-size: 24px;margin-left: 10px; color:red;">￥&nbsp;</span><span style="font-size: 15px;" class="money"></span>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" id="commit" class="btn btn-primary">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{--添加账号--}}

{{--账号修改--}}
<div class="modal inmodal fade" id="updateAccount" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">修改账号信息</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" method="post" action="/updateAccount">
                    <div class="form-group">
                        <label style="margin: 1px -11px 0px 70px; " class="col-sm-3 control-label">用户名：</label>
                        <div class="col-sm-8">
                            <input type="text" style="margin-top: 3px;width: 290px;" id="edit-name" name="username" value="" placeholder="用户名 -- (英文字母加数字)"  class="form-control">
                        </div>
                    </div>
                    <input type="hidden" id="edit-id" name="account_id" value="">
                    <div class="form-group">
                        <label style="margin: 24px -10px 0px 70px; "  class="col-sm-3 control-label">密码：</label>
                        <div class="col-sm-8">
                            <input type="text" style="margin-top: 27px;width: 290px;" id="edit-password" name="password" value=""  placeholder="密码" class="form-control">
                        </div>
                    </div>

                    @if(Session::get('MEMBER_INFO')['level'] ==2)
                        <div class="form-group">
                            <label style="margin: 33px -117px 0px 70px;" class="col-sm-3 control-label">速度：</label>
                            <div class="col-sm-8">
                                <input type="text" style="margin-top: 32px;margin-left: 109px;margin-bottom: 15px;width: 288px;" id="edit-speed" name="speed" value=""  placeholder="密码" class="form-control">
                            </div>
                        </div>
                    @endif
                    {!! csrf_field() !!}

                    <div class="modal-footer" style=" margin-top: 50px;text-align: center;">
                        <button type="button" class="btn btn-w-m btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" id="commit" class="btn btn-w-m btn-primary">修改</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{--账号修改--}}

{{--账号续费--}}
<div class="modal inmodal fade" id="myModal4" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 660px;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">账号续费</h4>
            </div>
            <div class="modal-body">
                <form method="post" action="/renewAccount">
                    <div class="modal-body">

                        <div class="input-group">
                            <span style="float: left;margin-top: 26px;font-size: 14px;margin-left: 70px;">天数：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="renew-date"  name="renew_date" class="form-control" value="1">
                        </div>

                        <div id="xufei">
                            <select style="float:right;" id="renew_type" class="form-control" name="renew_discount">
                                <option id="renew-day" selected  value="">日</option >
                                <option id="renew-week" value="">周</option>
                                <option id="renew-month" value="">月</option>
                            </select>
                        </div>
                        {!! csrf_field() !!}
                        <input type="hidden" id="connect-num" name="connect_num" value="">
                        <input type="hidden" id="data-name" name="username" value="">
                        <input type="hidden" id="data-password" name="password" value="">
                        <input type="hidden" id="data-price" name="price" value="">
                        <input type="hidden" id="data-type" name="renew_type" value="">
                        <input type="hidden" id="data-id" name="account_id" value="">

                        <div id="renew">
                            <span id="renew_tag">￥：</span> <span class="renew_price"></span>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary">确定</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{--账号续费--}}


{{--`批量续费--}}
<div class="modal inmodal fade" id="batch-renew-account-show" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 660px;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">账号续费</h4>
            </div>
            <div class="modal-body">
                <form method="post" action="/batchrenewaccount">
                    <div class="modal-body">
                        <div class="input-group">
                            <span style="float: left;margin-top: 6px;font-size: 14px;margin-left: 59px;">天数：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="batch-renew-date"  name="batch-renew-date" class="form-control" value="1">
                        </div>

                        <div id="xufei">
                            <select style="float:right;" id="batch-renew-type" class="form-control" name="renew_discount">
                                <option id="batch-renew-day" selected  value="">日</option >
                                <option id="batch-renew-week" value="">周</option>
                                <option id="batch-renew-month" value="">月</option>
                            </select>
                        </div>
                        {!! csrf_field() !!}
                        <input type="hidden"  id="batch-connect-num" value="">
                        <input type="hidden" name="batch-username" id="batch-username" value="">
                        <input type="hidden" name="batch-renew-date-type" id="batch-renew-date-type" value="">
                        <input type="hidden" name="batch-renew-price" id="batch-renew-price" value="">
                        <div id="renew">
                            <span id="batch-renew-tag">￥：</span> <span class="batch-price"></span>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary">确定</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{--`批量续费--}}


{{--批量添加账号--}}
<div class="modal inmodal fade" id="batch-add-account" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 660px;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">批量添加账号</h4>
            </div>
            <div class="modal-body">
                <form method="post" action="/batchaddaccount">
                    <div class="modal-body">

                        <div class="input-group">
                            <span style="float: left;margin-top: 6px;font-size: 14px;margin-left: 59px;">用户名：&nbsp;</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="batch-add-name"  placeholder="请输入用户名----例：xxxx" name="batch-add-username" class="form-control" value="">
                        </div>

                        <div class="input-group">
                            <span style="float: left;margin-top: 20px;font-size: 14px;margin-left: 59px;">密码：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="batch-passwword" placeholder="请输入密码"  name="batch-password" class="form-control" value="">
                        </div>

                        <div class="input-group">
                            <span style="float: left;margin-top: 20px;font-size: 14px;margin-left: 46px;">套餐类型：</span>
                            <input type="radio" name="set-meal-type" value="1" id="batch-add-set-meal-primary">初级套餐&nbsp;&nbsp;
                            <input type="radio" name="set-meal-type" checked value="2" value="option2" id="batch-add-set-meal-middle">中级套餐  &nbsp;  &nbsp;
                            <input type="radio" name="set-meal-type" value="3" id="batch-add-set-meal-height">高级套餐  &nbsp;  &nbsp;
                        </div>

                        <div class="input-group">
                            <span style="float: left;margin-top: 20px;font-size: 14px;margin-left: 49px;">账号数量：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="batch-add-num" placeholder="请输入账号数量"   name="batch-add-num" class="form-control" value="1">
                        </div>
                        <div class="input-group">
                            <span style="float: left;margin-top: 20px;font-size: 14px;margin-left: 36px;"> 账号连接数：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="connect" placeholder="请输入账号连接数" name="batch-connect-num" class="form-control" value="1">
                        </div>
                        <div class="input-group">
                            <span style="float: left;margin-top: 20px;font-size: 14px;margin-left: 59px;">天数：</span>
                            <input type="text" data-oval=""  autocomplete="new-password" id="batch-add-date"  name="batch-add-date" class="form-control" value="1">
                        </div>
                        <div id="xufei">
                            <select style="float:right;" id="batch-add-type" class="form-control" name="renew_discount">
                                <option id="batch-add-day" selected  value="">日</option >
                                <option id="batch-add-week"  value="">周</option>
                                <option id="batch-add-month"  value="">月</option>
                            </select>
                        </div>
                        {!! csrf_field() !!}
                        <input type="hidden" name="batch-add-date-type" id="batch-add-date-type" value="">
                        <input type="hidden" name="batch-add-price" id="batch-add-price" value="">

                        <div id="renew">
                            <span id="batch-renew-tag">￥：</span> <span class="batch-price"></span>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" id="batch-commit"  class="btn btn-primary">确定</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{--批量添加账号--}}


<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<script src="js/sort.js"></script>
<script src="js/add-account.js"></script>
<script src="js/renew.js"></script>
{{--<script src="js/filter/filter.js"></script>--}}



<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>

<script src="js/plugins/layer/laydate/laydate.js"></script>



<!-- Page-Level Scripts -->
<script>


    $("#filtrate").mouseover(function(){
        var show = $('#filtrate-show').css('display');
        $('#filtrate-show').css('display',show =='none'?'block':show);
    });


    $("#filtrate").mouseleave(function() {
        var show = $('#filtrate-show').css('display');
        $('#filtrate-show').css('display', show == 'block' ? 'none' : show);
    });

    $("input[name='account-cancel']").click(function(){

        $(this).attr("checked",false);

        if($('input:radio[name="account-type"]:checked').val()){
            $('input:radio[name="account-type"]:checked').attr("checked",false);
        }

    });


    $("input[name='expired_cancel']").click(function(){

        $(this).attr("checked",false);

        if($('input:radio[name="expired_at"]:checked').val()){
            $('input:radio[name="expired_at"]:checked').attr("checked",false);
        }

    });


    $("input[name='set_meal_cancel']").click(function(){

        $(this).attr("checked",false);

        if($('input:radio[name="set_meal_type"]:checked').val()){
            $('input:radio[name="set_meal_type"]:checked').attr("checked",false);
        }

    });




    function selectAll(){
        $("input[type='checkbox']").each( function() {
            if($(this).prop("checked")==true) {
                $("input[type='checkbox']").prop('checked', true);
                return;

            } else {
                $("input[type='checkbox']").prop('checked', false);
                return;
            }
        });
    }


    //  备注
    $(function(){

        $("#remark").keyup(function(){
            var len = $(this).val().length;
            if(len > 139){
                $(this).val($(this).val().substring(0,140));
            }
            var num = 140 - len + 1;
            $("#word").text(num);
        });
    });



    {{--//  批量删除--}}

    $('#batch-account-delete').click(function(){
        var id='';
        if($("input[name='check-box']:checked").length > 0)
        {

            $("input[name='check-box']:checked").each( function() {

                id = $(this).parent().prev().text()+','+id;
            });

            if(confirm('真的删除这些账号,删除以后该账号信息将不存在,请谨慎操作')) {
                $.ajax({
                    url: '/delete/account',          //  删除账号
                    type: 'get',
                    data: {
                        id: id
                    },
                    timeout: 5000,
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        if (data.error_code == 0) {
                            if (data.data == 'SUCCESS') {

                                $("input[name='check-box']:checked").each( function() {

                                    $(this).parent().parent().remove();
                                });
                                alert('删除成功');
                            }
                        } else {
                            alert(data.error_message);
                        }
                    }
                })

            }

        }else{
            alert("你还没选中什么！");
        }
    });

    //  添加账号
    $(function(){

        //  添加账号
        $('#addaccount').on('click',function(){
            checkMoney();
        });

        //   账户类型
        $('#accountType2').on('click',function(){
            checkMoney();
        });

        //   账户类型
        $('#accountType1').on('click',function(){
            checkMoney();
        });


        //  账户数量
        $('#num').bind('input onchange', function() {
            var num = $(this).val();
            checkMoney();
        });

        //  开通时间
        $('#date').bind('input onchange', function() {
            var date = $(this).val();
            if(date<0)
            {
                $(this).val(0);
            }
            checkMoney();
        });


        //   用户名
        $('#name').bind('input onchange', function() {
            var ch_reg = /^[u4E00-u9FA5{u-z}]+$/;//筛选包含汉字的字符
            var user_name = $("#name").val();
            if($.trim(user_name.val()) == ''){
                alert('用户名不能为空');
            }
            if(!ch_reg.test($.trim(user_name.val()))){
                alert('不可输入汉字');
            }
        });


        //  时间卡 类型  日  周  月
        $('#discount').bind('input onchange', function() {

            checkMoney();
        });


        $('#set-meal-primary').click(function() {
            checkMoney();
        });
        $('#set-meal-middle').click(function() {
            checkMoney();
        });
        $('#set-meal-height').click(function() {
            checkMoney();
        });
        //  检测money
        function checkMoney(){

            var discount = $('#discount').text();

            if($('#set-meal-primary').is(':checked'))
            {
                $('#day').val(primary_day);
                $('#week').val(primary_week);
                $('#month').val(primary_month);
            }


            if($('#set-meal-middle').is(':checked'))
            {
                $('#day').val(middle_day);
                $('#week').val(middle_week);
                $('#month').val(middle_month);
            }

            if($('#set-meal-height').is(':checked'))
            {
                $('#day').val(height_day);
                $('#week').val(height_week);
                $('#month').val(height_month);
            }


            var date = parseInt($('#date').val());
            var num = parseInt($('#num').val());
            var discount =   $('#discount option:selected').val();

            $('#date_type').val($('#discount option:selected').text());  //   日期类型

            if($('#num').val() =="" || $('#accountType2').is(':checked'))
            {
                $('.money').text('0.00');
                $('#discount').hide();
                $('#account-date').hide();
                $('#total-money').hide();

            }else if($('#date').val() =="" && $('#num').val() !="" && $('#accountType1').is(':checked')){
                $('#discount').show();
                $('#account-date').show();
                $('#total-money').show();
                $('.money').text(discount*num);
            }else{
                $('#discount').show();
                $('#account-date').show();
                $('#total-money').show();
                $('.money').text((date*discount*num));
            }

        }


        $("#commit").click(function(){

            var ch_reg = /^[u4E00-u9FA5{u-z}]+$/;//筛选包含汉字的字符
            var $user_name = $("#name").val();
            if($.trim($user_name.val()) == ''){
                alert('用户名不能为空');
            }
            if(!ch_reg.test($.trim($user_name.val()))){
                alert('不可输入汉字');
            }


            var num  = parseInt($('#num').val());
            if(num == '' && num <=0)
            {
                alert('非法的连接数');
            }

            var passowrd = $("#passowrd").val();
            alert(passowrd);
            if($.trim(passowrd.val()) == ''){
                alert('密码不能为空');
            }

        });
    });


    $("#commit").click(function(){

        var ch_reg = /^[u4E00-u9FA5{u-z}]+$/;//筛选包含汉字的字符
        var $user_name = $("#name").val();
        if($.trim($user_name.val()) == ''){
            alert('用户名不能为空');
        }
        if(!ch_reg.test($.trim($user_name.val()))){
            alert('不可输入汉字');
        }


        var num  = parseInt($('#num').val());
        if(num == '' && num <=0)
        {
            alert('非法的连接数');
        }


        var passowrd = $("#passowrd").val();
        alert(passowrd);
        if($.trim(passowrd.val()) == ''){
            alert('密码不能为空');
        }

    });

</script>
<script>


    function fnClickAddRow() {
        $('#editable').dataTable().fnAddData([
            "Custom row",
            "New row",
            "New row",
            "New row",
            "New row"]);

    }
</script>





</body>

</html>
